package com.app.utils;


import com.alibaba.fastjson.JSONObject;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

@Component
public class TestUtil {

    @Scheduled(cron = "0 07 14 ? * *")
    public void auto(){
        System.out.println("定时任务执行了，");
        RestTemplate client = new RestTemplate();
        JSONObject data = new JSONObject();
        data.put("loginName","20020210138");
        data.put("password","123123");
        ResponseEntity<String> stringResponseEntity = client.postForEntity("http://120.24.211.119:8081/practice/user/login",
                data,String.class);

        System.out.println(stringResponseEntity.toString());
    }

}
